package io.gitee.hefren.hhregistry.beans;

import com.google.common.base.MoreObjects;
import com.google.common.collect.Maps;
import org.springframework.util.LinkedMultiValueMap;


import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;

/**
 * @Date 2024/5/22
 * @Author lifei
 */
public class HhregsitrySnapshot {

    private LinkedMultiValueMap<String, InstanceMeta> instances;
    private Map<String, Long> versions;
    public Map<String, Long> timestemps;
    private Long version;

    public HhregsitrySnapshot() {
    }

    public HhregsitrySnapshot(LinkedMultiValueMap<String, InstanceMeta> instances, Map<String, Long> versions, Map<String, Long> timestemps, Long version) {
        this.instances = instances;
        this.versions = versions;
        this.timestemps = timestemps;
        this.version = version;
    }

    public LinkedMultiValueMap<String, InstanceMeta> getInstances() {
        return instances;
    }

    public void setInstances(LinkedMultiValueMap<String, InstanceMeta> instances) {
        this.instances = instances;
    }

    public Map<String, Long> getVersions() {
        return versions;
    }

    public void setVersions(Map<String, Long> versions) {
        this.versions = versions;
    }

    public Map<String, Long> getTimestemps() {
        return timestemps;
    }

    public void setTimestemps(Map<String, Long> timestemps) {
        this.timestemps = timestemps;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(HhregsitrySnapshot.class)
                .add("instances", instances)
                .add("versions", versions)
                .add("timestemps", timestemps)
                .add("version", version)
                .toString();
    }
}
